package com.greedy.hateoas.demo.order.repository;

import com.greedy.hateoas.demo.order.entity.OrderEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

/**
 * @Author: Yanxy
 * @Date: Created in:2023/07/12
 * Description: 股票数据层服务接口
 */
@RepositoryRestResource(path = "/order")
public interface OrderRepository extends JpaRepository<OrderEntity, Long> {

    /**
     * 根据用户查询订单
     * @param user 用户名
     * @return 订单列表
     */
    public List<OrderEntity> findByUser(@Param("user") String user);

}
